package com.qf.purchase.service;

import com.github.pagehelper.PageInfo;
import com.qf.purchase.dao.GoodTypeDao;
import com.qf.purchase.po.Brand;
import com.qf.purchase.po.GoodType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class GoodTypeServiceImpl implements GoodTypeService{
    @Resource
    private GoodTypeDao goodTypeDao;

    @Override
    public boolean addGoodType(GoodType goodType) {
        boolean f = goodTypeDao.addGoodType(goodType)>0?true:false;
        return f;
    }

    @Override
    public PageInfo<GoodType> getAllGoodTypeByPage(Map params) {
        List<GoodType> goodTypeList=goodTypeDao.getAllGoodTypeByPage(params);
        PageInfo<GoodType> pageInfo = new PageInfo<GoodType>(goodTypeList);
        return pageInfo;
    }

    @Override
    public boolean updateGoodType(GoodType goodType) {
        return goodTypeDao.updateGoodType(goodType)>0;
    }

    @Override
    public GoodType findGoodTypeById(int id) {
        return goodTypeDao.findGoodTypeById(id);
    }
}
